import { useModel } from '@umijs/max';
import React from 'react';

const AvatarName: React.FC = () => {
  const { initialState } = useModel('@@initialState');

  // 使用 initialState 中的用户信息，如果没有则显示默认值
  return <span>{initialState?.currentUser?.name || 'Admin'}</span>;
};

export default AvatarName;
